package bravo.xc.com.xc_bravo_android.operation.orderdetails;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import bravo.xc.com.xc_bravo_android.R;
import bravo.xc.com.xc_bravo_android.base.BaseMVPActivity;
import butterknife.ButterKnife;
import butterknife.Unbinder;

public class OrderDetailsActivity extends BaseMVPActivity<OrderDetailsContract.TakeawayDetailsView,OrderDetailsContract.TakeawayDetailsPresenter> implements OrderDetailsContract.TakeawayDetailsView, View.OnClickListener {

    private LinearLayout layout_title_left;
    private TextView tv_title_meg;
    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.layout_title_left:
                finish();
                break;
        }
    }


    @Override
    protected OrderDetailsContract.TakeawayDetailsPresenter createPresnter() {
        return new OrderDetailsPresenter();
    }

    @Override
    protected void initView() {
        layout_title_left=(LinearLayout)findViewById(R.id.layout_title_left);
        layout_title_left.setOnClickListener(this);
        tv_title_meg=(TextView)findViewById(R.id.tv_title_msg);
    }

    @Override
    protected void initData() {
        tv_title_meg.setText("订单详情");
    }

    @Override
    protected int getContentViewId() {
        return R.layout.activity_order_details;
    }

    @Override
    protected Unbinder getBinder() {
        return ButterKnife.bind(OrderDetailsActivity.this);
    }

    @Override
    protected void onChildDestroy() {
        presenter.onDetached();
    }

    @Override
    public void showToast(String str) {
        Toast.makeText(OrderDetailsActivity.this,str,Toast.LENGTH_SHORT).show();
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
}
